package com.ads.orm.log;

import java.text.MessageFormat;

import org.apache.log4j.Logger;

public class Log {
	private Logger logger;

	private Log(Class<?> clazz) {
		logger = Logger.getLogger(clazz);
	}

	private Log(String name) {
		logger = Logger.getLogger(name);
	}

	public static Log getLogger(Class<?> clazz) {
		return new Log(clazz);
	}

	public static Log getLogger(String name) {
		return new Log(name);
	}

	public void trace(String message, Throwable t, Object... arguments) {
		trace(MessageFormat.format(message, arguments), t);
	}

	public void trace(String message, Object... arguments) {
		trace(MessageFormat.format(message, arguments));
	}

	public void trace(Object message, Throwable t) {
		logger.trace(message, t);
	}

	public void trace(Object message) {
		logger.trace(message);
	}

	public void debug(String message, Throwable t, Object... arguments) {
		debug(MessageFormat.format(message, arguments), t);
	}

	public void debug(String message, Object... arguments) {
		debug(MessageFormat.format(message, arguments));
	}

	public void debug(Object message, Throwable t) {
		logger.debug(message, t);
	}

	public void debug(Object message) {
		logger.debug(message);
	}

	public void error(String message, Throwable t, Object... arguments) {
		error(MessageFormat.format(message, arguments), t);
	}

	public void error(String message, Object... arguments) {
		error(MessageFormat.format(message, arguments));
	}

	public void error(Object message, Throwable t) {
		logger.error(message, t);
	}

	public void error(Object message) {
		logger.error(message);
	}

	public void fatal(String message, Throwable t, Object... arguments) {
		fatal(MessageFormat.format(message, arguments), t);
	}

	public void fatal(String message, Object... arguments) {
		fatal(MessageFormat.format(message, arguments));
	}

	public void fatal(Object message, Throwable t) {
		logger.fatal(message, t);
	}

	public void fatal(Object message) {
		logger.fatal(message);
	}

	public void info(String message, Throwable t, Object... arguments) {
		info(MessageFormat.format(message, arguments), t);
	}

	public void info(String message, Object... arguments) {
		info(MessageFormat.format(message, arguments));
	}

	public void info(Object message, Throwable t) {
		logger.info(message, t);
	}

	public void info(Object message) {
		logger.info(message);
	}

	public void warn(String message, Throwable t, Object... arguments) {
		warn(MessageFormat.format(message, arguments), t);
	}

	public void warn(String message, Object... arguments) {
		warn(MessageFormat.format(message, arguments));
	}

	public void warn(Object message, Throwable t) {
		logger.warn(message, t);
	}

	public void warn(Object message) {
		logger.warn(message);
	}
}
